package com.woniuxy.yygh.cmn.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <P> @Author: ideaAdmin
 * <P>  Class
 * <P> Hosp配置类
 * <P> Date: 2022/2/27:14:00
 * <P> Description:
 */
@Configuration
@MapperScan("com.woniuxy.yygh.cmn.mapper")
public class CmnConfig {

    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

    /**
     * 乐观锁插件
     */
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInterceptor();
    }
}
